x86/HAP: adjust monitor table related error handling
authorJan Beulich <jbeulich@suse.com>
Tue, 11 Oct 2022 12:52:59 +0000 (14:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 11 Oct 2022 12:52:59 +0000 (14:52 +0200)
commit3422c19d85a3d23a9d798eafb739ffb8865522d2
treeccaadd6a704f8b652938da77f01eb012772b49d9
parent8fc19c143b8aa563077f3d5c46fcc0a54dc04f35
x86/HAP: adjust monitor table related error handling

hap_make_monitor_table() will return INVALID_MFN if it encounters an
error condition, but hap_update_paging_modes() wasn’t handling this
value, resulting in an inappropriate value being stored in
monitor_table. This would subsequently misguide at least
hap_vcpu_teardown(). Avoid this by bailing early.

Further, when a domain has/was already crashed or (perhaps less
important as there's no such path known to lead here) is already dying,
avoid calling domain_crash() on it again - that's at best confusing.

This is part of CVE-2022-33746 / XSA-410.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
master commit: 5b44a61180f4f2e4f490a28400c884dd357ff45d
master date: 2022-10-11 14:21:56 +0200
xen/arch/x86/mm/hap/hap.c